#include "DTORunwayRelated.h"
#include "../../utils/Logger.h"

DTORunwayRelated::DTORunwayRelated(std::string& aDeserealizar): DTO(RUNWAY_RELATED){
	deserializar(aDeserealizar);
}

DTORunwayRelated::DTORunwayRelated(runwayRequestType requestType,unsigned int runwayId) : DTO(RUNWAY_RELATED){
	this->requestType= requestType;
	this->runwayId= runwayId;
}

DTORunwayRelated::~DTORunwayRelated() {
}

std::string DTORunwayRelated::serializar(){
	std::stringstream retorno;

	retorno << DTO::serializar();
	retorno << UtilString::intToString(requestType);
	retorno << PLANO_SEPARATOR;
	retorno << UtilString::intToString(runwayId);

	return (retorno.str());
}

runwayRequestType DTORunwayRelated::getRequestType(){
	return (this->requestType);
}

unsigned int DTORunwayRelated::getRunwayId(){
	return (this->runwayId);
}

void DTORunwayRelated::deserializar(std::string& string){
	std::vector<std::string> valores;
	UtilString::splitWithSeparator(&valores,string,PLANO_SEPARATOR);

	requestType = (runwayRequestType)UtilString::stringToInt(valores[1]);
	runwayId = UtilString::stringToInt(valores[2]);
}

